package com.cunzai.blog.application.article.dto;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cunzai.blog.common.PO.Article;
import lombok.Data;

import java.util.List;

@Data
public class ArticlePageResponse {

    private List<Article> articles;
    private long total;
    private long currentPage;
    private long totalPages;

    public ArticlePageResponse(Page<Article> page) {
        this.articles = page.getRecords();
        this.total = page.getTotal();
        this.currentPage = page.getCurrent();
        this.totalPages = page.getPages();
    }

    // 省略 getter 和 setter 方法
}

